package me.firstapp.service.bbs;

import me.firstapp.common.utils.Page;
import me.firstapp.module.bbs.Collection;

public interface CollectionService {

	/**
	 * 查询商品或话题的被收藏数量
	 * 
	 * @param memberId
	 * @param topicId
	 * @param productId
	 * @param apiClientId
	 * @return
	 */
	Long findCollectionCounts(Long memberId, Long topicId, Long productId, Long apiClientId);

	/**
	 * 查询用户是否收藏话题
	 * 
	 * @param memberId
	 * @param topicId
	 * @param apiClientId
	 * @return
	 */
	Collection findMemberTopicCollectionRel(Long memberId, Long topicId, Long apiClientId);

	/**
	 * 查询用户是否收藏商品
	 * 
	 * @param memberId
	 * @param productId
	 * @param apiClientId
	 * @return
	 */
	Collection findMemberProductCollectionRel(Long memberId, Long productId, Long apiClientId);

	/**
	 * 用户收藏商品或话题
	 * 
	 * @param memberId
	 * @param topicId
	 * @param productId
	 * @param type
	 * @param apiClientId
	 * @return
	 */
	Collection addCollection(Long memberId, Long topicId, Long productId, Integer type, Long apiClientId);

	/**
	 * 取消收藏
	 * 
	 * @param memberId
	 * @param topicId
	 * @param productId
	 * @param type
	 * @param apiClientId
	 */
	void executeCancelCollection(Long memberId, Long topicId, Long productId, Integer type, Long apiClientId);

	/**
	 * 分页查询收藏
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param memberId
	 * @param type
	 * @param apiClientId
	 * @return
	 */
	Page<Collection> findMemberCollectionsPage(Integer pageNo, Integer pageSize, Long memberId, Integer type,
			Long apiClientId);
}
